The present invention relates to a processing method for compressed image data and an apparatus thereof, and more particularly to a method and apparatus for demodulating a bit stream based on MPEG normal standard and outputting the same on a screen in an display order.
Recently, in an image processing apparatus, image data has been often encoded according to the MPEG normal standard and then processed. In such an image processing apparatus, an image data demodulating circuit needs to be provided for demodulating the image data encoded by the MPEG.
When the image data encoded by the MPEG is demodulated in the image data demodulating circuit and outputted on a display screen, inputted bit stream is stored in succession in video buffering verifier (VBV) buffer and the bit stream is read out in succession and after variable length demodulation, inverse quantization, inverse DCT and motion compensation are carried out, it is stored in a frame buffer. Then, that bit stream is read out from the frame buffer and outputted on the display screen. Here, the VBV buffer and frame buffer are secured on the same RAM.
Although there is no problem in the above conventional method if the image size of the inputted bit streams is constant, if bit streams (the VBV buffer size and frame buffer size are also different) different in the image size are continuously inputted, there occurs a necessity of allocating a memory region on a RAM corresponding to a maximum image data which can be inputted, so as to secure a VBV buffer and frame buffer preliminarily.
Unless the VBV buffer and frame buffer are secured corresponding to the maximum image data, when the bit stream of an image size different from a currently demodulating image size is inputted and consequently, the buffer size needs to be changed, there occurs a problem that data within the VBV buffer and data within the frame buffer may be destroyed when each buffer size is changed, so that an error occurs in an reproduced image thereby the reproduced image being not beautiful to see.
It is an object of the invention to provide an image data demodulation apparatus which interrupts fetching of image data if the image type is changed and after a memory capacity of a VBV buffer corresponding to the size of image is automatically set up, carrying out storage processing for the image data.
To achieve the above object, the present invention provides an image data demodulation apparatus comprising input control means for controlling ON/OFF of an input of encoded image data corresponding to a given control signal; detecting means for detecting a sequence header from the encoded image data supplied from the input control means; extracting means for, when the detecting means detects the sequence header from the encoded image data supplied from the input control means, detecting a predetermined data about the kind of image data from the encoded image data supplied from the input control means; storage means for storing the encoded image data supplied from the input control means in a memory region; control signal output means for outputting the control signal and supplying the control signal to the input control means based on the sequence header detected by the detecting means and the predetermined data extracted by the extracting means; and demodulation means for demodulating the encoded image data stored in the memory region of the storage means.
According to the present invention having such a structure, if the image type is changed, this is read from the sequence header and fetching of the image is interrupted immediately. Then, data corresponding to the image type is extracted from the image data so as to secure a memory region corresponding to the image type. As a result, a possibility that data within the buffer is destroyed by a change in the buffer size is eliminated unlike in the prior art.
Further, in the image data demodulation method of the present invention as well, because of the same gist, even if the image type is changed, destruction of data can be prevented.
Additional objects and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objects and advantages of the invention may be realized and obtained by means of the instrumentalities and combinations particularly pointed out hereinafter.